<?php
//QT261 Lổi pagination trang

Yii::app()->clientScript->registerScriptFile (Yii::app()->baseUrl.'/js/number/jquery.autotab-1.1b.js');
	$script = <<<SCRIPT
		jQuery(function(){
			jQuery('#A_AREACODE, #A_PREFIXCODE, #A_PHONENUMBER').autotab_magic().autotab_filter('numeric');
		});
SCRIPT;
	Yii::app()->clientScript->registerScript('PHONE', $script, CClientScript::POS_END);
?>

<div class="bg_tt_page">
<div class="my">My Account</div>
<div class="ac">Add/Modify Phone</div>
</div>

<div class="center_page_afterlogin">
	<div class="col_left"><?php $this->renderPartial('//common/leftCustomer'); ?></div>
	<div class="col_right">
		<div class="p10l p10t">
			
			<!-- LIST PHONE + DELETE PHONE-->
			<div class="box_phonenumber w396 float_left">
				<?php 
					
					$this->widget('ext.MListView', array(
						'table_header' => '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr class="bg_table">
										    <td width="71%" class="boder_right"><strong>Phone number</strong></td>
										    <td align="center" width="29%"><strong>Action</strong></td>
										  </tr>',
						'table_footer' => '</tbody></table>',
					    'dataProvider' => $dataProvider,
					    'itemView' => '_viewPhone',
						'template' => "{items}\n{pager}",
						'pagerCssClass' => 'pag',
						'pager' => array(
							'cssFile' => Yii::app()->baseUrl.'/css/mypager.css',
							'header' => '',
							'firstPageLabel'=>'<<',
							'prevPageLabel'=>'<img src="images/bule_prev.png" />',
							'nextPageLabel'=>'<img src="images/bule_next.png" />',	
							'lastPageLabel'=>'>>',
						),
					) );
				?>
			</div>
			
			<!-- ADD PHONE-->
			<div class="w380 float_left p10l">
				<div class="p12t p13b">If you would like to register another phone number, please enter the new number here:<br />
					<br /> For Example: (714) xxx-xxxx<br />
					<br />
						Area - Telephone No.
					<div class="p5t">
					<?php 
						$form = $this->beginWidget('CActiveForm', array(
							'id' => 'add-phone-form',
						));
					
						echo $form->textField($model,'areaCode', array('id' => 'A_AREACODE', 'maxlength' => '3', 'class' => 'text_telephone'));
						echo $form->textField($model, 'prefixCode', array('id' => 'A_PREFIXCODE', 'maxlength' => '3', 'class' => 'text_telephone'));
						echo $form->textField($model, 'phoneNumber', array('id' => 'A_PHONENUMBER', 'maxlength' => '4', 'class' => 'text_telephone'));
						
						//Error
						echo $form->errorSummary($model);
					?>
					<div class="cb"></div>
					<?php 
						echo CHtml::link('Register', '#',array('submit' => array(''),'class' => 'bt_submit', ));
					?>
						
					<?php $this->endWidget(); ?>
					</div>
				</div>
				<div class="bo_b_t p10t">Note: You are registering a phone number so you 
					can call anywhere in the world without having to enter a PIN number. If
					you would like to call by using a PIN number, please contact our
					customer service center.
				</div>
			</div>
			<div class="cb"></div>
		</div>
	</div>
	<div class="cb"></div>
</div>
<div class="bottom_pages_afterlogin"></div>
